#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "Action.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class Association;
class InputPin;
class LinkEndData;

/// <summary>
/// LinkAction
/// LinkAction is an abstract class for all Actions that identify the links to be
/// acted on using LinkEndData.
/// </summary>
class UMLMODEL_EXPORT LinkAction : public Action {

public: // Constructors and destructors
    explicit LinkAction(const QString& umlType="uml::LinkAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Methods
    /// <summary>
    /// association
    /// Returns the Association acted on by this LinkAction.
    /// </summary>
    virtual shared_ptr<Association> association() const;

public: // Properties
    /// <summary>
    /// endDatas getter
    /// The LinkEndData identifying the values on the ends of the links acting on by
    /// this LinkAction.
    /// </summary>
    vector<shared_ptr<LinkEndData>>& endDatas();

    /// <summary>
    /// inputValues getter
    /// InputPins used by the LinkEndData of the LinkAction.
    /// </summary>
    vector<shared_ptr<InputPin>>& inputValues();

private: // Fields
    /// <summary>
    /// endDatas
    /// The LinkEndData identifying the values on the ends of the links acting on by
    /// this LinkAction.
    /// </summary>
    vector<shared_ptr<LinkEndData>> endDatas_;

    /// <summary>
    /// inputValues
    /// InputPins used by the LinkEndData of the LinkAction.
    /// </summary>
    vector<shared_ptr<InputPin>> inputValues_;

};

} // namespace uml
